package com.sg.business.management.nvselectorcontrol;

import org.eclipse.jface.viewers.IStructuredSelection;

import com.sg.business.model.ManagermentCategory;
import com.sg.widgets.part.editor.fields.INavigatorSelectorControl;

public class CategoryNavigatorControl implements INavigatorSelectorControl {

	public CategoryNavigatorControl() {
	}

	@Override
	public boolean isSelectEnable(IStructuredSelection is) {
		Object firstElement = is.getFirstElement();
		if(firstElement instanceof ManagermentCategory) {
			ManagermentCategory managermentCategory = (ManagermentCategory) firstElement;
			boolean settingValue = managermentCategory.isSettingValue();
			if(settingValue) {
				return true;
			}
		}
		return false;
	}

}
